home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir27 / grphca22.zip / EXAMPLES.ZIP / CONTROL.PLT < prev    next >
Text File  |  1993-02-03  |  746b  |  31 lines

  1. paper size 11 by 8.5
  2.  
  3. #
  4. # warning:  this demo is SLOW on PCs without math coprocessors!
  5. #
  6. # From _Automatic_Control_Systems_, fourth ed., figure 6-14
  7. # transient response of a second-order system to a unit step input function
  8. #
  9. frame
  10. title 'TRANSIENT RESPONSE OF A SECOND-ORDER SYSTEM'
  11. damp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
  12. per(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
  13. c(t) = 1-damp(t)*per(t)
  14. #
  15. #    wn is natural undamped frequency
  16. #    s is damping factor
  17. #
  18. wn = 1.0
  19. map x 0 13
  20. samples 50
  21. dummy t
  22. #
  23. # plot c(t) for several different damping factors s
  24. #
  25. color lred
  26. plot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
  27. color lblue
  28. draw x y
  29. xlabel 'time'
  30. ylabel 'response'
  31.